﻿using System;
using System.Collections.Generic;
using System.Text;

namespace designmodule.behavioralmodule.ChainofResponsibility
{
    class program
    {
        void main()
        {
            var h1 = new ConcreteHandler1();
            var h2 = new ConcreteHandler2();
            var h3 = new ConcreteHandler3();

            h1.SetSuccessor(h2);
            h2.SetSuccessor(h3);

            int[] request = {2, 5, 14, 22, 18, 27, 20};

            foreach (var i in request)
            {
                h1.HandleRequest(i);
            }
        }
    }
}
